<?php
// +----------------------------------------------------------------------
// | makePHP 
// +----------------------------------------------------------------------
// | Copyright (c) 2009 http://makephp.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed BSD.(http://www.make.org/BSD-license.txt)
// +----------------------------------------------------------------------
// | Author: 叁石(sanshi) <sanshi0815@tom.com>
// | Author: 白家昌<baijc2004cn@126.com>
// +----------------------------------------------------------------------
/**
 * 功能: 错误信息
 * 创建日期:Wed Oct 29 11:06:24 CST 2008
 * 最后更新:
 * 作者: Brown 
 */

/**
 * @name    ErrorMsg
 * @version	1.0.0 (Wed Oct 29 11:06:41 CST 2008)
 * @author	Brown
 */
class ErrorMsg
{
	public $global_errors;
	/**
	 * 构造 方法
	 * 
	 * */
	public function ErrorMsg(){
        self::getErrorArray();
	}
	public function __construct(){
		$this->ErrorMsg();
	}

    /**
     * 取得错误信息数组
     * */
	public function getErrorArray(){
		$include_file = ERROR_FILE_PATH.LANGUAGE_CHARSET.'_error.inc.php';
		$include_file = file_exists($include_file) ? $include_file : ERROR_FILE_PATH.'cn_error.inc.php';
		$this->global_errors = require_once($include_file);
	}
	/**
	 * 获取错误信息
	 * @param unknown_type $errorNo
	 */
	public function getErrorMsg($errorNo){
	    $errorMsg = isset($this->global_errors[$errorNo]) ? $this->global_errors[$errorNo] :'';
	    //echo $errorMsg;exit();
	    return !empty($errorMsg) ? $errorMsg : $this->global_errors['-1000'];
	}
}
?>